var express = require('express');
var router = express.Router();
var chainquery = require('../apple/query');
var chaininvoke = require('../apple/invoke_buy');

/* GET buy page. */
router.get('/invoke', function(req, res, next) {
    var opt = [];
    opt[0] = "transport";
    opt[1] = "buyApple";
    opt[2] = req.query.id;
    opt[3] = req.query.Variety;
    // opt[4] = req.query.Price;
    opt[4] = "5000";
    opt[5] = req.query.Company;
    opt[6] = req.query.Market;
    opt[7] = req.query.Amount;
    console.log(opt);
    chaininvoke.invoke(opt, res);

});

module.exports = router;
